package com.rinvay.network.http.exception;

import java.util.HashMap;

public class ErrorMessage
{
    public static final int ERROR_CODE_NETWORK_INVALID = 100;

    public static final int ERROR_CODE_MALFORMED_URL = ERROR_CODE_NETWORK_INVALID + 1;

    public static final int ERROR_CODE_OPEN_CONNECTION = ERROR_CODE_MALFORMED_URL + 1;

    private static HashMap<Integer, String> errors = new HashMap<Integer, String>();

    static {
        errors.put(ERROR_CODE_NETWORK_INVALID, "没有可用的网络连接");
        errors.put(ERROR_CODE_MALFORMED_URL, "错误的URL");
        errors.put(ERROR_CODE_OPEN_CONNECTION, "无法连接到服务器");
    }

    public static String getErrorMessage(int errorCode) {
        return errors.get(errorCode);
    }
}
